package com.heima.domain.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class PageDTO<T> {
    private Long total; // 总记录数
    private Long pageNum; // 每页记录数
    private Long pageSize;// 总页数
    private Long current; // 当前页码
    private List<T> records;

    // 统一构造方法
    public PageDTO(Long total, Long size, Long pages, Long current, List<T> records) {
        this.total = total;
        this.pageNum = size;
        this.pageSize = pages;
        this.current = current;
        this.records = records;
    }
}
